#!/bin/bash -e

function info() {
echo Usage: `basename $0` 'namelist'
exit 2
}

while getopts  ":p:f:" opt; do
	case  $opt  in
		p) out_prefix=$OPTARG;;
		f) suffix=$OPTARG;;
		*) info;;
	esac
done
shift $(($OPTIND - 1))


if [ $# -lt 1 ]; then info; fi


cat $1|sed s/_/-/g |sort|uniq > /tmp/namelist.tmp

cat /tmp/namelist.tmp|grep -v '-' > $out_prefix.namelist

cat /tmp/namelist.tmp|grep '-' > /tmp/namelist.tmp1

cat /tmp/namelist.tmp1|sed s/\-//g > /tmp/namelist.tmp2

cat /tmp/namelist.tmp1|sed s/\-/_/g > /tmp/namelist.tmp3

paste /tmp/namelist.tmp1 /tmp/namelist.tmp2 /tmp/namelist.tmp3 > $out_prefix.namelist1

# find . -f -name ''



